package Lambda.Supplier;

import java.util.function.Supplier;

public class SupplierMax {
    private static Integer getMax(Supplier<Integer> sup){
        return sup.get();
    }

    public static void main(String[] args) {
       int[] arr={12,22,14,12,41,512,211,53,985};
       int s=getMax(()->{
           int max=arr[0];
           for (int i : arr) {
               if (i>max){
                   max=i;
               }
           }
           return max;
       });
        System.out.println(s);
    }
}
